package zack.gateway.center.domain.message.service;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

/**
 * @author A1793
 */
@Service
public class Publisher {
    private final RedisTemplate<String,Object> redisTemplate;

    public Publisher(RedisTemplate<String, Object> redisTemplate) {
        this.redisTemplate = redisTemplate;
    }
    public void pushMessage(String topic,Object message){
        redisTemplate.convertAndSend(topic,message);
    }
}
